#ifdef VERTEX
uniform mat4 uProjMatrix;
uniform mat4 uViewMatrix;
uniform mat4 uModelMatrix;

layout(location = 0) in vec4 aPosition;
layout(location = 1) in vec2 aTexCoord;
layout(location = 2) in vec4 aNormal;
layout(location = 3) in vec4 aColor;

out vec4 vPosition;
out vec2 vTexCoord;

void main()
{
	vec4 position = uViewMatrix * uModelMatrix * aPosition;
	vPosition = position;
	vTexCoord = aTexCoord;
	gl_Position = uProjMatrix * position;
}
#endif

#ifdef FRAGMENT
uniform sampler2D uAlphaMap;

in vec4 vPosition;
in vec2 vTexCoord;
out vec4 fragColor;

void main()
{
	if (texture(uAlphaMap, vTexCoord).a < 0.5) discard;
	fragColor = vec4(vPosition.zzz, 1.0);
}
#endif